home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / e_to_l / iacs / setup.arv / UNIT1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-09-15  |  3.2 KB  |  124 lines

  1. Unit Unit1;
  2.  
  3. Interface
  4.  
  5. Uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, Buttons, StdCtrls, Iacs, Iaconn, Iadialgs, Iabuttns;
  8. Const
  9.   hlp_cntx_Registering = 999;
  10.  
  11. Type
  12.   TForm1 = class(TForm)
  13.     GroupBox1: TGroupBox;
  14.     IAListBox1: TIAListBox;
  15.     IAEdit1: TIAEdit;
  16.     Label1: TLabel;
  17.     Button1: TButton;
  18.     SaveListBoxItems: TIACheckBox;
  19.     Button2: TButton;
  20.     BitBtn1: TBitBtn;
  21.     GroupBox2: TGroupBox;
  22.     IALabel1: TIALabel;
  23.     IALabel2: TIALabel;
  24.     IAEditCombo1: TIAEditCombo;
  25.     Label2: TLabel;
  26.     IAComboBox1: TIAComboBox;
  27.     IASRButton1: TIASRButton;
  28.     IASRButton2: TIASRButton;
  29.     INISaveItemsChkBx: TIACheckBox;
  30.     KeepHistoryChkBx: TIACheckBox;
  31.     Label3: TLabel;
  32.     BitBtn2: TBitBtn;
  33.     Label4: TLabel;
  34.     IASource1: TIASource;
  35.     Button3: TButton;
  36.     procedure Button1Click(Sender: TObject);
  37.     procedure Button2Click(Sender: TObject);
  38.     procedure SaveListBoxItemsClick(Sender: TObject);
  39.     procedure FormCreate(Sender: TObject);
  40.     procedure INISaveItemsChkBxClick(Sender: TObject);
  41.     procedure KeepHistoryChkBxClick(Sender: TObject);
  42.     procedure BitBtn2Click(Sender: TObject);
  43.     procedure Button3Click(Sender: TObject);
  44.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  45.   private
  46.     { Private declarations }
  47.   public
  48.     { Public declarations }
  49.   end;
  50.  
  51. var
  52.   Form1: TForm1;
  53.  
  54. implementation
  55.  
  56. {$R *.DFM}
  57.  
  58. procedure TForm1.Button1Click(Sender: TObject);
  59. begin
  60.   {If the editbox isn't empty then add the text to the IAListbox}
  61.   If IAEdit1.Text <> '' then
  62.     IAListBox1.Items.Add(IAEdit1.Text);
  63. end;
  64.  
  65. procedure TForm1.Button2Click(Sender: TObject);
  66. begin
  67.   {Clear the IAListBox contents}
  68.   IAListBox1.Items.Clear;
  69. end;
  70.  
  71. procedure TForm1.SaveListBoxItemsClick(Sender: TObject);
  72. begin
  73.   {Set the INISaveItems property from the checkbox}
  74.   IAListBox1.INISaveItems:=SaveListBoxItems.Checked;
  75. end;
  76.  
  77. procedure TForm1.FormCreate(Sender: TObject);
  78. begin
  79.   IASource1.FileName:=ExtractFilePath(Application.ExeName)+IASource1.FileName;
  80.  
  81.   IAComboBox1.KeepHistory:=KeepHistoryChkBx.Checked;
  82.   IAComboBox1.INISaveItems:=INISaveItemsChkBx.Checked;
  83.   IAListBox1.INISaveItems:=SaveListBoxItems.Checked;
  84.  
  85.   {Get the Location of the help file from the INI file
  86.     The directory was put there by Eschalon Setup
  87.     This is so the 'HelpContext' call in the OrderingBtn
  88.     click handler will call the right file}
  89.   With Application Do
  90.   Begin
  91.     HelpFile:=IASource1.ReadString('Location','Help File','');
  92.     If HelpFile <> '' then HelpFile:=HelpFile+'\Iacs.Hlp';
  93.   End;
  94.  
  95.   IASource1.UpdateControls;
  96. end;
  97.  
  98. procedure TForm1.INISaveItemsChkBxClick(Sender: TObject);
  99. begin
  100.   IAComboBox1.INISaveItems := INISaveItemsChkBx.Checked;
  101. end;
  102.  
  103. procedure TForm1.KeepHistoryChkBxClick(Sender: TObject);
  104. begin
  105.   IAComboBox1.KeepHistory := KeepHistoryChkBx.checked;
  106. end;
  107.  
  108. procedure TForm1.BitBtn2Click(Sender: TObject);
  109. begin
  110.   Application.HelpContext( hlp_cntx_Registering );
  111. end;
  112.  
  113. procedure TForm1.Button3Click(Sender: TObject);
  114. begin
  115.   IAComboBox1.Items.Clear;  
  116. end;
  117.  
  118. procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
  119. begin
  120.   IASource1.UpdateFile;
  121. end;
  122.  
  123. end.
  124.